{% import 'macros/buttons.html' as buttons with context %}

{% macro query_options(action=None, search_label=None, add_label=None) -%}
    {% set action = action or scaffolding.plural %}
    {% set search_label = search_label or 'search ' + scaffolding.plural %}
    {% set add_label = add_label or 'new ' + scaffolding.singular %}
    <div class="row">
      <div class="col-xs-6">
        <label for="query">{{ search_label }}:</label>
      </div>
    </div>
    <div class="row">
      <div class="col-xs-6">
        <form role="form" action="{{ action }}">
            <div class="input-group">
                <input id="query" type="text" name="query" class="form-control input-sm" value="{{search_query|default('')}}" placeholder="all">
                <span class="input-group-btn">
                <button class="btn btn-sm btn-primary" type="submit" rel="tooltip" title="search"><i class="glyphicon glyphicon-search icon-white"></i></button>
              </span>
            </div>
        </form>
      </div>
      <div class="col-xs-6 text-right">
        {{ buttons.add_button(add_label, tip="add " + add_label) }}
      </div>
    </div>
{%- endmacro %}